/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * WelcomePanel.java
 *
 * Created on Jul 11, 2011, 10:25:52 PM
 */
package panels;

import java.awt.Dimension;
import main.MainFrame;
import obj.Page;

/**
 *
 * @author jm1156
 */
public class WelcomePanel extends javax.swing.JPanel {

  /** Creates new form WelcomePanel */
  public WelcomePanel() {
    initComponents();
  }

  /** This method is called from within the constructor to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    jLayeredPane1 = new javax.swing.JLayeredPane();
    jPanel1 = new javax.swing.JPanel();
    loginButton = new javax.swing.JButton();
    registerButton = new javax.swing.JButton();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();

    setPreferredSize(new java.awt.Dimension(800, 600));
    setLayout(new java.awt.GridBagLayout());

    jLayeredPane1.setName("jLayeredPane1"); // NOI18N

    jPanel1.setName("jPanel1"); // NOI18N
    jPanel1.setOpaque(false);

    loginButton.setText("Login");
    loginButton.setMaximumSize(new java.awt.Dimension(73, 23));
    loginButton.setMinimumSize(new java.awt.Dimension(73, 23));
    loginButton.setName("loginButton"); // NOI18N
    loginButton.setOpaque(false);
    loginButton.setPreferredSize(new java.awt.Dimension(73, 23));
    loginButton.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        loginButtonActionPerformed(evt);
      }
    });
    jPanel1.add(loginButton);

    registerButton.setText("Register");
    registerButton.setName("registerButton"); // NOI18N
    registerButton.setOpaque(false);
    registerButton.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        registerButtonActionPerformed(evt);
      }
    });
    jPanel1.add(registerButton);

    jPanel1.setBounds(320, 340, 160, 33);
    jLayeredPane1.add(jPanel1, javax.swing.JLayeredPane.PALETTE_LAYER);

    jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/resources/WebsiteLogo.png"))); // NOI18N
    jLabel2.setName("jLabel2"); // NOI18N
    jLabel2.setOpaque(true);
    jLabel2.setBounds(40, 50, 718, 274);
    jLayeredPane1.add(jLabel2, javax.swing.JLayeredPane.PALETTE_LAYER);

    jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/resources/Background.png"))); // NOI18N
    jLabel3.setMaximumSize(new java.awt.Dimension(800, 600));
    jLabel3.setMinimumSize(new java.awt.Dimension(800, 600));
    jLabel3.setName("jLabel3"); // NOI18N
    jLabel3.setPreferredSize(new java.awt.Dimension(800, 600));
    jLabel3.setBounds(0, 0, 800, 600);
    jLayeredPane1.add(jLabel3, javax.swing.JLayeredPane.DEFAULT_LAYER);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.ipadx = 800;
    gridBagConstraints.ipady = 600;
    gridBagConstraints.weightx = 0.1;
    gridBagConstraints.weighty = 0.1;
    add(jLayeredPane1, gridBagConstraints);
  }// </editor-fold>//GEN-END:initComponents

    private void loginButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginButtonActionPerformed
      MainFrame mainFrame = MainFrame.getInstance();
      Page page = new Page();
      page.setTitle("Login");
      mainFrame.setPanel(page);
    }//GEN-LAST:event_loginButtonActionPerformed

    private void registerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_registerButtonActionPerformed
      MainFrame mainFrame = MainFrame.getInstance();
      Page page = new Page();
      page.setTitle("Register");
      Dimension dim = this.getSize();      
      mainFrame.setPanel(page);
    }//GEN-LAST:event_registerButtonActionPerformed
  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JLabel jLabel2;
  private javax.swing.JLabel jLabel3;
  private javax.swing.JLayeredPane jLayeredPane1;
  private javax.swing.JPanel jPanel1;
  private javax.swing.JButton loginButton;
  private javax.swing.JButton registerButton;
  // End of variables declaration//GEN-END:variables
}
